//
//  XiangqingHeaderView.m
//  B段项目
//
//  Created by 徐茂怀 on 15/11/4.
//  Copyright © 2015年 徐茂怀. All rights reserved.
//

#import "XiangqingHeaderView.h"
#import "FitHeader.h"
@implementation XiangqingHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}

-(void)createView
{
    _titleLabel = [[UILabel alloc]init];
    _titleLabel.font = [UIFont fontWithName:@"EuphemiaUCAS-Bold" size:25 * FitWidth];
    _MyImageView = [[UIImageView alloc]init];
    _MyImageView.layer.masksToBounds = YES;
    _MyImageView.layer.cornerRadius = 16 * FitWidth;
    _userNameLabel = [[UILabel alloc]init];
    _userNameLabel.font = [UIFont fontWithName:@"EuphemiaUCAS-Bold" size:18 * FitWidth];
    _timeLabel = [[UILabel alloc]init];
    _timeLabel.font = [UIFont fontWithName:@"Helvetica-LightOblique" size:15 * FitWidth];
    _contentLabel = [[UILabel alloc]init];
    _contentLabel.font = [UIFont fontWithName:@"EuphemiaUCAS-Bold" size:20 * FitWidth];
    _contentLabel.numberOfLines = 0;
    _shicaiLabel = [[UILabel alloc]init];
    _shicaiLabel.font = [UIFont fontWithName:@"EuphemiaUCAS-Bold" size:20 * FitWidth];
    _shicaiLabel.textColor = [UIColor colorWithRed:0.12 green:0.63 blue:0.59 alpha:1];
    _shicaiLabel.text = @"食材";

    
    [self addSubview:_titleLabel];
    [self addSubview:_MyImageView];
    [self addSubview:_userNameLabel];
    [self addSubview:_timeLabel];
    [self addSubview:_contentLabel];
    [self addSubview:_shicaiLabel];
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    _titleLabel.frame = CGRectMake(10 * FitWidth, 10 * FitHeight, 200 * FitWidth, 30 * FitHeight);
    _MyImageView.frame = CGRectMake(10 * FitWidth, _titleLabel.frame.origin.y + _titleLabel.frame.size.height + 10 * FitHeight, 40 * FitWidth, 40 * FitHeight);
    _userNameLabel.frame = CGRectMake(_MyImageView.frame.origin.x + _MyImageView.frame.size.width + 5 * FitWidth, _MyImageView.frame.origin.y, 200 * FitWidth, 20 * FitHeight);
    _timeLabel.frame = CGRectMake(_userNameLabel.frame.origin.x, _userNameLabel.frame.origin.y + _userNameLabel.frame.size.height + 3 * FitHeight, 200 * FitWidth, 20 * FitHeight);
    _contentLabel.frame = CGRectMake(10 * FitWidth, _MyImageView.frame.origin.y + _MyImageView.frame.size.height + 20 * FitHeight, 340 * FitWidth, 60 * FitHeight);
    _shicaiLabel.frame = CGRectMake(10 * FitWidth, _contentLabel.frame.origin.y + _contentLabel.frame.size.height + 20 * FitHeight, 200 * FitWidth, 20 * FitHeight);
}

@end
